<?php

/*
 * ************************************************* 
 * Created on :2012-5-24 11:16:01
 * Encoding   :UTF-8
 * Description:
 * 
 * @Author @lqs <soso2501@gmail.com>
 * @WAP_WEIBO (C)1996-2099 SINA Inc. 
 * ************************************************
 */

function smarty_modifier_shortstr($str, $length) {
    $str = strip_tags($str);
    $r = mb_substr($str, 0, $length, "utf8");
    if (mb_strlen($str, "utf8") > $length)
        $r.= "...";
    return $r;
}